package com.yumis.service.common.enums;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @包名: com.yumis.common.enums
 * @类名: HttpState
 * @作者: dampson
 * @描述: 返回状态枚举类
 * @日期: 2020/10/19 2:06 下午
 * @版本: 1.0.0
 */
@NoArgsConstructor
@AllArgsConstructor
public enum HttpState {
    //全局公用状态吗
    OK(0, "OK"),
    CREATED(0, "创建成功"),
    UPDATE(0, "更新成功"),
    DELETE(0, "删除成功"),

    INVALID_FILE_FORMAT(400, "文件格式错误"),
    UPLOAD_IMAGE_EXCEPTION(500, "文件上传异常"),
    FILE_NOT_EXIST(404, "文件不存在"),


    //操作相关 1XXX
    UNKNOWN_ERROR(10000, "未知错误"),
    PARAM_ERROR(10001, "参数错误"),
    DELETE_ERROR(10002, "删除失败"),
    CREATED_FAILED(10003, "新增失败"),
    DATA_NOT_FOUNT(10004, "无数据"),
    UPDATE_ERROR(10005, "更新失败"),

    //用户相关
    USER_NOT_FOUND(20002, "此用户不存在"),
    PASSWORD_ERROR(20003, "密码不正确"),

    //商品相关
    ;

    int code;
    String message;

    public int code() {
        return this.code;
    }
    public String message() {
        return this.message;
    }

}
